import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
        path: "/",
        redirect: "/Login"
    },
    {
        path: '/login',
        name: '/Login',
        component: () =>
            import ('../views/Login/Login'), //按需引入
    },

    { // 主页
        path: '/home',
        name: 'Home',
        component: () =>
            import ('../views/childrenviews/Home'), //按需引入
        meta: { //用来判断是否显示TabBar组件
            showTabBar: true
        }
    },
    { //收藏
        path: '/collect',
        name: 'Collect',
        component: () =>
            import ('../views/childrenviews/Collect'), //按需引入
        meta: { //用来判断是否显示TabBar组件
            showTabBar: true
        }
    },
    { //我的
        path: '/my',
        name: 'My',
        component: () =>
            import ('../views/childrenviews/My'), //按需引入
        meta: { //用来判断是否显示TabBar组件
            showTabBar: true
        }
    },
    { //我的
        path: '/collectb/:id',
        name: 'CollectB',
        component: () =>
            import ('../views/childrenviews/CollectB'), //按需引入
        meta: { //用来判断是否显示TabBar组件
            showTabBar: true
        }
    }
]

const router = new VueRouter({
    routes
})

export default router